# Maintainer: David Runge <dvzrv@archlinux.org>

pkgname=autorandr
pkgver=1.14
pkgrel=1
pkgdesc="Auto-detect connected display hardware and load appropiate X11 setup using xrandr"
arch=(any)
url="https://github.com/phillipberndt/autorandr"
license=(GPL3)
depends=(
  python
  python-packaging
  xorg-xdpyinfo
  xorg-xrandr
)
makedepends=(
  bash-completion
  desktop-file-utils
  systemd
)
optdepends=(
  'bash-completion: auto-completion for autorandr in Bash'
  'zsh-completions: auto-completion for autorandr in ZSH'
)
source=($pkgname-$pkgver.tar.gz::https://github.com/phillipberndt/$pkgname/archive/$pkgver.tar.gz)
sha512sums=('dc1ee4c28b06dde4a721fe564734e7a79c1c843986f7c84307ea60f19c2237ba53d1bcd2202e377363e7e0a5bf5dea95bea4490b3fa5ec5fa6738114646a502d')
b2sums=('3ff149d30b023bc54d83c4be1f81f67204d20d3e6a7a43e15009c1c4f1180fa920789ce84ae56f13946a9cec1f72bc7adb27be3c58ca8532235d0457b1f5aa92')

package() {
  make DESTDIR="$pkgdir" PREFIX=/usr install -C $pkgname-$pkgver
  # zsh completion
  install -vDm 644 $pkgname-$pkgver/contrib/zsh_completion/_$pkgname -t "$pkgdir/usr/share/zsh/site-functions/"
  # docs
  install -vDm 644 $pkgname-$pkgver/README.md -t "$pkgdir/usr/share/doc/$pkgname/"
}
